.DEFAULT_GOAL:=help
.PHONY: help build grammer install xscanner 

help: ## 帮助
	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
build: ## 编译wheel
	rm -rf dist
	poetry build -f wheel
grammer: ## 编译语法
	antlr -Xexact-output-dir -o xscanner/grammar -no-listener -visitor -Dlanguage=Python3 anltr/RuleLexer.g4 anltr/RuleParser.g4
install: ## 安装
	poetry install
	poetry run xscanner --help
	poetry run xscanner --version
xscanner: ## 扫描
	poetry run xscanner scan tests/rule.ss tests/fixtures
test: ## 测试
	poetry run pytest -s
tox: ## tox
	poetry run tox